package com.bootcamp.s2_0922.ds._0922;

/**
 * @program: 35th_2_DS_snowlee
 * @description:
 * @author: Keyu Li
 * @create: 2021-09-22 17:00
 **/

public class Demo1 {

    public static int mm = 1;

    public static void main(String[] args) {
        Node zs = new Node(1, null, null);
        Node ls = new Node(2, null, zs);
        Node ww = new Node(3, null, ls);
        Node zl = new Node(4, null, ww);
        zs.next = ls;
        ls.next = ww;
        ww.next = zl;
        System.out.println(zs);
    }
}


class Node {
    public int value;
    public Node next;
    public Node pre;

    public Node(int value, Node next, Node pre) {
        this.value = value;
        this.next = next;
        this.pre = pre;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Node{");
        sb.append("value=").append(value);
        sb.append(", next=").append(next);
        sb.append('}');
        return sb.toString();
    }
}